package com.llm.travel_agent_assistant.controller;

import com.llm.travel_agent_assistant.dto.Result;
import com.llm.travel_agent_assistant.service.BudgetAnalyzeService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/budget")
public class BudgetController {

    @Resource
    private BudgetAnalyzeService budgetAnalyzeService;

    @GetMapping("/query_budget_analysis")
    public Result queryBudgetAnalysis(@RequestParam("userId") String userId) {
        return budgetAnalyzeService.getAnalysisByUserId(userId);
    }

    @GetMapping("/analysis_info")
    public Result getAnalysisInfo(@RequestParam("analysisId") String analysisId) {
        return budgetAnalyzeService.getAnalysisById(analysisId);
    }

    @DeleteMapping("/delete_budget_analysis")
    public Result deleteBudgetAnalysis(@RequestParam("analysisId") String analysisId) {
        return budgetAnalyzeService.deleteAnalysisById(analysisId);
    }
}